#include "total.h"

int main(){
	int number1 = 10,number2 = -20,abs_result = 0;
	long long factorial_result = 0;
	factorial_result = factorial_calc(number1);
	abs_result = abs_calc(number2);
	std::cout << number1 <<  " 阶乘为:" << factorial_result << std::endl;
	std::cout << number2 << "绝对值为:" << abs_result << std::endl;
	return 0;
	
	
}

long factorial_calc(int number){
	long factorial_result = 1;
	if(number == 0)
		return 1;
	else{
		for(int i = 1;i <= number;++i)
			factorial_result *= i;
		return factorial_result;
	}

}


int abs_calc(int number){
	if(number == 0)
		return 0;
	else
		if(number < 0)
			return -number;
		else
			return number;
	
}
